package com.hub.utils.enums;

import lombok.Getter;

/**
 * @author hub
 */
@Getter
public enum ActiveFlgEnum {
    Effective(1,"有效"),
    Invalid(0,"无效");

    private int code;
    private String description;

    ActiveFlgEnum(int code, String desc) {
        this.code = code;
        this.description = desc;
    }

    /**
     * 获取枚举值的描述
     * @param index
     * @return
     */
    public static String getDescription(int index) {
        for(ActiveFlgEnum uge : ActiveFlgEnum.values()){
            if(uge.getCode() == index){
                return uge.description;
            }
        }
        return "未知编码";
    }
}
